<?php
/**
 * DBShop 电子商务系统
 *
 * ==========================================================================
 * @link      https://www.dbshop.net/
 * @copyright 北京珑大钜商科技有限公司，并保留所有权利。
 * @license   https://www.dbshop.net/license.html License
 * ==========================================================================
 *
 * @author    静静的风 <baron@loongdom.cn>
 *
 */

namespace Admin\Service\Common\Express;

class Kuaidi100Free
{
    private $expressConfig;

    public function setExpressConfig(array $expressConfig)
    {
        $this->expressConfig = $expressConfig;
    }

    /**
     * 查询的链接地址
     * @param array $data
     * @param $unifiedDelivery
     * @return array
     */
    public function ExpressQuery(array $data, $unifiedDelivery)
    {
        if (!$unifiedDelivery) return ['state' => true, 'content' => "<a href='https://www.kuaidi100.com/chaxun?com=".$data['code']."&nu=".$data['number']."' target='_blank'>点击查看物流轨迹</a>"];

        header("Location: https://www.kuaidi100.com/chaxun?com=".$data['code']."&nu=".$data['number']);
        exit();
    }
}